import type { SparkTypes } from '#/utils/types/types';

/**
 * 定义 RowType 接口，用于描述 系统操作日志 数据库行的结构。
 */
export interface RowType {
  id: string;
  moduleName: string;
  businessType: number;
  methodName: string;
  requestMethod: string;
  operatorType: number;
  operName: string;
  deptName: string;
  operUrl: string;
  operIp: string;
  operLocation: string;
  operParam: string;
  jsonResult: string;
  status: number;
  errorMsg: string;
  operTime: any;
  costTime: any;
  createBy: string;
  createTime: string;
  updateBy: string;
  updateTime: string;
}

/**
 * 详情字段配置
 */
export const DetailsColumns: SparkTypes.DetailsTypes[] = [
  {
    title: '模块',
    field: 'moduleName',
  },
  /* 数据字典*/
  {
    title: '业务类型',
    field: 'businessType',
    params: {
      dictCode: 'operate_type',
    },
  },
  {
    title: '请求URL',
    field: 'operUrl',
  },
  {
    title: '方法名称',
    field: 'methodName',
    span: 3,
  },
  {
    title: '请求方式',
    field: 'requestMethod',
  },
  {
    title: '操作人员',
    field: 'operName',
  },
  {
    title: '主机地址',
    field: 'operIp',
  },
  {
    title: '操作地点',
    field: 'operLocation',
  },
  {
    title: '操作状态',
    field: 'status',
    params: {
      dictCode: 'ok_fail',
    },
  },
  {
    title: '操作时间',
    field: 'operTime',
  },
  {
    title: '消耗时间',
    field: 'costTime',
  },
];
